<template>
  <div class="dashboard">
    <!-- 1. 顶部数字展示 -->
    <el-row :gutter="10">
      <template v-for="item in amountList" :key="item.amount">
        <el-col :span="6" :xs="24" :sm="12" :md="8" :lg="6">
          <count-card v-bind="item" />
        </el-col>
      </template>
    </el-row>
    <!-- 2. 中间图表展示 -->
    <el-row :gutter="10">
      <template v-for="item in 3">
        <el-col :span="8">
          <chart-card />
        </el-col>
      </template>
    </el-row>
    <!-- 3. 底部图表展示 -->
    <el-row :gutter="10">
      <template v-for="item in 2">
        <el-col :span="12">
          <chart-card />
        </el-col>
      </template>
    </el-row>
  </div>
</template>

<script setup lang="ts">
import countCard from './c-cpns/count-card/count-card.vue'
import chartCard from './c-cpns/chart-card/chart-card.vue'

import { storeToRefs } from 'pinia'
import useAnalysisStore from '@/stores/main/analysis/analysis.ts'

// 数据请求
const analysisStore = useAnalysisStore()
analysisStore.setAmountList()
// 获取数据
const { amountList } = storeToRefs(analysisStore)
</script>

<style lang="less" scoped>
.el-row {
  margin-bottom: 10px;
}
</style>
